(function($) {
	var popoDict = {};
	var pageIndex = 0,limitNum = 20
	var pageData,magazingData;
	var PersonID,PersonName,perInfo,nurseId
	var unUploadFiles=[] //未上传的图片
	var fileParam = getFileMethods('成果转化')
	var fileConut = 0;
	$.init();
	$.plusReady(function() {
		var self = plus.webview.currentWebview();
		pageData = self.pageData;
		perInfo = app.getState()
		mui.previewImage();
		if (perInfo) {
			PersonID = perInfo.loginPerID
			nurseId = perInfo.loginID
			PersonName = perInfo.loginName
		}
		if (pageData) {
			if(pageData['Files'] != ''){
				fileConut = pageData['Files'].split(',').length;
			}
			updateArticalUI()
			if (pageData.RecFlag != 'N') {
				document.body.classList.add('towBtnType')
			}
		}else{
			var FirstPer = document.getElementById('FirstPer');
			FirstPer.innerHTML = PersonName;
			getPersonInfo(PersonID,PersonName)
			getPopoverData('成果转化专利类型', false)
			getPopoverData('成果转化方式', false)
			getPopoverData('成果转化提成方式', false)
			getPersonPopoData(false);
		}
		baseSetup();
	});
	
	function saveTrans(parr,tipStr){
		if(!pageData && tipStr == '保存'){
			if (unUploadFiles.length==0) {
				mui.toast('请上传至少一个附件！')
				return;
			}
		}else{
			if(fileConut == 0 && tipStr == '保存'){
				mui.toast('没有上传附件！')
				return;
			}
		} 
		plus.nativeUI.showWaiting('正在'+tipStr);
		var pdict = {'className':'DHCINM.SM.SciTrans',rowIdKey:'RowID',parr: parr}
		var paramDict = {'method':'web.INMSMComm:SaveSciTrans','params':JSON.stringify(pdict),'type':'Method'}
	   	console.log(JSON.stringify(pdict))
		mui.DHCWebService(paramDict, function(result) {
			plus.nativeUI.closeWaiting();
			if (result.msgcode != '1' || parseInt(result.msg) <= 0) {
				mui.toast(tipStr+'失败'+result.msg)
				return
			}
			mui.toast(tipStr+'成功')
			if (unUploadFiles.length==0) {
				var list = plus.webview.getWebviewById('../WKPlatformPages/personInfo/listPage.html')
				if (list) {
					list.evalJS('resetRefresh()')
				}
				mui.back()
				return;
			}
			var paramDict={'id':result.msg,'path':fileParam.path,'imgArr':unUploadFiles,'fileParam':fileParam}
			saveFileAction(paramDict,function(flag){
				if (!flag) {
					return
				}
				unUploadFiles=[]
				var list = plus.webview.getWebviewById('../WKPlatformPages/personInfo/listPage.html')
				if (list) {
					list.evalJS('resetRefresh()')
				}
				mui.back()
			})
		}, function(errorStr) {
			mui.toast(errorStr);
			plus.nativeUI.closeWaiting();
		});	
	}
	
	function getPersonPopoData(show){
		if(show) {
			plus.nativeUI.showWaiting('正在加载');
		}
		var searchInput = document.getElementById('searchInput');
		searchInput.blur()
		var pdict = {'parr':'!!!'+perInfo.loginRoleCodes+'!'+PersonID,'input':searchInput.value,start:(pageIndex*limitNum),limit: limitNum}
		var paramDict = {'method':'web.INMPersonComm:FindPersons','params':JSON.stringify(pdict),'type':'RecQuery'}
		// console.log(JSON.stringify(pdict))
		mui.DHCWebService(paramDict, function(result) {
			plus.nativeUI.closeWaiting();
			var dataArr = result.data;
			popoDict['person'] = dataArr;
			updatePagePopoverUI(dataArr);
			if (show) {
				mui('#pagePopo').popover('show');
			}
			var pageNum = document.getElementById('pageNum');
			pageNum.innerHTML = pageIndex+1;
		}, function(errorStr) {
			updatePagePopoverUI(undefined,errorStr);
			if (show) {
				mui('#pagePopo').popover('show');
			}
			plus.nativeUI.closeWaiting();
			var pageNum = document.getElementById('pageNum');
			pageNum.innerHTML = pageIndex+1;
		});		
	}
	
	function updatePagePopoverUI(dataArr,errorStr){
		mui('#pagePopoWrapper').scroll().scrollTo(0,0,100)
		mui('#pageUI').off('tap','li',personLiTapped) 
		var pageUI = document.getElementById('pageUI')
		if (!dataArr) {
			pageUI.innerHTML = errorStr
			return
		}
		var html = ''
		for (var i = 0;i < dataArr.length;i++) {
			var dict = dataArr[i]
			html += '<li class="mui-table-view-cell" data-id="'+dict['PerID']+
				'" data-index="'+i+'">'+dict['PerID']+'--'+dict['PerName']+'</li>'
		}
		pageUI.innerHTML = html
		mui('#pageUI').on('tap','li',personLiTapped) 
	}
	function personLiTapped(){
		event.stopPropagation()
		var searchInput = document.getElementById('searchInput');
		searchInput.blur();
		var index = parseInt(this.getAttribute('data-index'))
		var dict = popoDict['person'][index]
		getPersonInfo(dict['rowid'],dict['PerName']);
	}
	function getPersonInfo(perId,name){
		plus.nativeUI.showWaiting('正在加载');
		var pdict = {'id':perId}
		var paramDict = {'method':'web.INMPersonComm:GetPerson','params':JSON.stringify(pdict),'type':'RecMethod'}
		//console.log(JSON.stringify(pdict))
		mui.DHCWebService(paramDict, function(result) {
			plus.nativeUI.closeWaiting();
			//console.log(JSON.stringify(result));
			var dict = result.data
			updatePersonUI(dict,perId,name)
			mui('#pagePopo').popover('hide');
			var oldActive = document.querySelector('.dhc-active');
			if(oldActive) {
				oldActive.classList.remove('dhc-active');
			}
			mui('#searchInput')[0].value = ''
			getPersonPopoData(false);
		}, function(errorStr) {
			mui.toast(errorStr+',请重试')
			plus.nativeUI.closeWaiting();
		});	
	}
	
	function getPopoverData(type, show) {
		if(show) {
			plus.nativeUI.showWaiting('正在加载');
		}
		var pdict = {'type':type}
		var paramDict = {'method':'web.INMDBComm:FindPubCode','params':JSON.stringify(pdict),'type':'Query'}
			// console.log(JSON.stringify(pdict))
		mui.DHCWebService(paramDict, function(result) {
			plus.nativeUI.closeWaiting();
//			console.log(result)
			var dataArr = result.data
			popoDict[type] = dataArr;
			if(show) {
				updateNormalPopoverUI(dataArr)
			}
		}, function(errorStr) {
			if(show) {
				mui.toast(errorStr);
				updateNormalPopoverUI(undefined,errorStr)
			}
			plus.nativeUI.closeWaiting();
		});
	}
	function updateNormalPopoverUI(dataArr,errorStr) {
		mui('#normalPopoWrapper').scroll().scrollTo(0,0,100)
		mui('#normalUI').off('tap','li',normalPopoLiTapped)
		var normalUI = document.getElementById('normalUI');
		if (!dataArr) {
			normalUI.innerHTML = errorStr
			return
		}
		var html = ''
		for(var i = 0; i < dataArr.length; i++) {
			var dict = dataArr[i];//
			html += '<li class="mui-table-view-cell" data-id="' + dict['SubValue'] + '">' + dict['SubDesc'] + '</li>'
		}
		normalUI.innerHTML = html;
		mui('#normalUI').on('tap','li',normalPopoLiTapped) 
		var lis = normalUI.querySelectorAll('li')
		for(var i = 0; i < lis.length; i++) {
			lis[i].addEventListener('tap', normalPopoLiTapped, false);
		}
		var normalPopo = document.getElementById('normalPopo');
		normalPopo.classList.add('mui-active');
	}
	function normalPopoLiTapped(){
		event.stopPropagation();
		var active = document.querySelector('.dhc-active');
		active.setAttribute('data-id', this.getAttribute('data-id'));
		active.innerHTML = this.innerText;
		var popover = document.getElementById('normalPopo');
		popover.classList.remove('mui-active');
		var oldActive = document.querySelector('.dhc-active');
		if(oldActive) {
			oldActive.classList.remove('dhc-active');
		}
	}
	
	function updateArticalUI(){
		// console.log(JSON.stringify(pageData));
		var scrollWrapper = document.getElementById('scrollWrapper');
		var inputs = scrollWrapper.querySelectorAll('input');
		for (var i = 0; i < inputs.length;i++) {
			var dom = inputs[i];
			var valueStr = pageData[dom.id];
			if (valueStr != undefined) {
				dom.value = valueStr
			}
		}
		var iconDowns = scrollWrapper.querySelectorAll('.item-content.icon-down');
		for (var i = 0; i < iconDowns.length;i++) {
			var dom = iconDowns[i]
			var idStr = dom.id;
			if ('FirstPer,SecPer,ThirdPer'.indexOf(idStr) != -1) {
				updatePersonUI(pageData,undefined,undefined,'FirstPer')
				updatePersonUI(pageData,undefined,undefined,'SecPer')
				updatePersonUI(pageData,undefined,undefined,'ThirdPer')
				continue
			}
			var attrStr = pageData[idStr];
			var valueStr = pageData[idStr+'Desc'];
			dom.setAttribute('data-id',dealUndefined(attrStr));
			if (valueStr != undefined) {
				dom.innerHTML = valueStr
			}
			
		}
		var dataDoms = scrollWrapper.querySelectorAll('.item-content.icon-schedule');
		for (var i = 0; i < dataDoms.length;i++) {
			var dom = dataDoms[i]
			var valueStr = pageData[dom.id];
			if (valueStr != undefined) {
				dom.innerHTML = valueStr
			}
		}
		updateFileUI('Files','Files',pageData,pageData['RowID'],fileParam.path)
	}

	function baseSetup() {
		mui('.mui-scroll-wrapper').scroll();
		mui('body').on('hidden', '.mui-popover', function(e) {
			var oldActive = document.querySelector('.dhc-active');
			if(oldActive) {
				oldActive.classList.remove('dhc-active');
			}
			allInputBlur()
			if (e.target.id == 'pagePopo'){
				var searchInput = document.getElementById('searchInput');
				searchInput.value = ''
				getPersonPopoData(false);
			}else {
				return;
			}
		});
		//选择日期
		mui('body').on('tap','.icon-schedule',function(){
		  if (plus.os.name == 'iOS') {
		  	iOSPickArticalDate(this);
		  }else{
		  	pickArticalDate(this);
		  }
		}) 
		
		var iconDowns = document.querySelectorAll('.icon-down');
		for(var i = 0; i < iconDowns.length; i++) {
			iconDowns[i].addEventListener('tap', function() {
				setupIconDownTapped(this);
			});
		}
		var inputs = document.querySelectorAll('#scrollWrapper input');
		for(var i = 0; i < inputs.length; i++) {
			 if (inputs[i].id == 'searchInput') {
			 	continue;
			 }
			inputs[i].addEventListener('focus', function() {
				var popover = document.getElementById('normalPopo');
				popover.classList.remove('mui-active');
				var oldActive = document.querySelector('.dhc-active');
				if(oldActive) {
					oldActive.classList.remove('dhc-active');
				}
				this.classList.add('dhc-active')
			}, false);
			inputs[i].addEventListener('blur', function() {
				this.classList.remove('dhc-active')
			}, false);
		}
		//保存按钮
		var saveBtn = document.getElementById('saveBtn');
		saveBtn.addEventListener('tap', function(){
			saveAndSubmitBtnTapped(this);
		}, false);
		var unValidBtn = document.getElementById('unValidBtn');
		unValidBtn.addEventListener('tap', function(){
			var btn = this;
			mui.confirm('确定作废此文章吗？','作废文章',['暂不','确定作废'],function(e){
				if (e.index == 1) {
					saveAndSubmitBtnTapped(btn);
				}
			});
		}, false);
		//设置完成人popo的搜索 上一页,下一页
		var searchBtn = document.getElementById('searchBtn');
		searchBtn.addEventListener('tap', function(){
			var searchInput = document.getElementById('searchInput');
			searchInput.blur();
			pageIndex = 0;
			getPersonPopoData(true)
		}, false);
		var lastPage = document.getElementById('lastPage');
		lastPage.addEventListener('tap', function(){
			var searchInput = document.getElementById('searchInput');
			searchInput.blur();
			if (pageIndex == 0) {
				mui.toast('已经是第一页了')
				return;
			}
			pageIndex -= 1;
			getPersonPopoData(true)
		}, false);
		var nextPage = document.getElementById('nextPage');
		nextPage.addEventListener('tap', function(){
			var searchInput = document.getElementById('searchInput');
			searchInput.blur();
			if (popoDict['person'].length < limitNum) {
				mui.toast('已经是最后一页了')
				return;
			}
			pageIndex += 1;
			getPersonPopoData(true);
		}, false);
		var scrollWrapper = document.getElementById('scrollWrapper');
		scrollWrapper.addEventListener('scroll',function(){
			if (document.querySelector('.mui-popover.mui-active')) {
				var popover = document.getElementById('normalPopo');
				popover.classList.remove('mui-active');
				var oldActive = document.querySelector('.dhc-active');
				if(oldActive) {
					oldActive.classList.remove('dhc-active');
				}
			}
		});
		$('#addFileBtn').on('change','input',function(){
			var imgArr = this.files
			unUploadFiles = afterSelectFile('Files',unUploadFiles,imgArr)
			fileConut = unUploadFiles.length
		});
		mui('#Files').on('tap','.mui-btn',function(){
			plus.nativeUI.showWaiting('正在删除');
			var paramDict={'imgArr':unUploadFiles,'fileParam':fileParam}
			deleteFileBtnTapped(this,paramDict,function(flag,arr){
				plus.nativeUI.closeWaiting();
				if (arr!=undefined) {
					unUploadFiles = arr
					fileConut = unUploadFiles.length
				}
			});
		}) 
		mui.back = function(){
			if (unUploadFiles.length > 0) {
				mui.confirm('您有未上传的文件','温馨提示',['放弃','继续操作'],function (e) {
					if (e.index == 0) {
						plus.nativeUI.closeWaiting()
						plus.webview.currentWebview().close()
					}
				},'div')
				return
			}
			plus.nativeUI.closeWaiting()
			plus.webview.currentWebview().close()
		}
	}

	function saveAndSubmitBtnTapped(btn) {
		//7个必填项: 类别 杂志名称 发表日期 文章题目 文章类型 发表栏目 第一作者
		var scrollWrapper = document.getElementById('scrollWrapper');
		var rw = ''
		if (pageData) {
			rw = pageData['RowID']
		} 
		var tipStr = '保存'
		var xmlStr = 'RowID|'+rw+'^Creator|'+nurseId;//科研S 课题T 文章A 专利P
		if (btn.id == 'unValidBtn') {
			xmlStr += '^RecFlag|N'
			tipStr = '作废'
		}else{
			xmlStr += '^RecFlag|Y'
		}
		//input框
		var inputs = scrollWrapper.querySelectorAll('input');
		for (var i = 0; i < inputs.length;i++) {
			var dom = inputs[i]
			if (!dom.id) {
				continue
			}
			var str = dom.value;
			var idStr = dom.id;
			if (str == '') {
				var preDom = dom.previousElementSibling;
				var tip = preDom.innerText
				if (tip.indexOf('*') != -1) {
					var toastStr = '请填写' + tip.replace('*','');
					mui.toast(toastStr);
					return;
				}
			}
			xmlStr += '^'+idStr+'|'+str
		}
		xmlStr += getPerStr('FirstPer',mui('#FirstPer')[0])
		//下拉选择
		var iconDowns = scrollWrapper.querySelectorAll('.item-content.icon-down');
		for (var i = 0; i < iconDowns.length;i++) {
			var dom = iconDowns[i]
			var str = dealUndefined(dom.getAttribute('data-id'));
			var idStr = dom.id;
			if (str =='') {
				var preDom = dom.previousElementSibling;
				var tip = preDom.innerText
				if (tip.indexOf('*') != -1) {
					var toastStr = '请选择' + tip.replace('*','');
					mui.toast(toastStr);
					return;
				}
			}
			if (idStr == 'SecPer' || idStr.indexOf('ThirdPer') != -1) {
				xmlStr += getPerStr(idStr,dom)
			}else{
				xmlStr += '^'+idStr+'|'+str
			}
		}
		//日期
		var dates = scrollWrapper.querySelectorAll('.item-content.icon-schedule');
		for (var i = 0; i < dates.length;i++) {
			var dom = dates[i]
			var str = dom.innerText;
			var idStr = dom.id;
			if (str == '') {
				var preDom = dom.previousElementSibling;
				var tip = preDom.innerText
				if (tip.indexOf('*') != -1) {
					var toastStr = '请选择' + tip.replace('*','');
					mui.toast(toastStr);
					return;
				}
			}
			xmlStr += '^'+idStr+'|'+str
		}
		saveTrans(xmlStr,tipStr)
	}
	function getPerStr(idStr,dom){
		var hisNo = mui('#'+idStr+'-hisNo')[0] //职称
		var Post = mui('#'+idStr+'-Post')[0] //职务
		var PerDuty = mui('#'+idStr+'-PerDuty')[0] //职称
		var PerLeve = mui('#'+idStr+'-PerLeve')[0] //层级
		var MajorDep = mui('#'+idStr+'-MajorDep')[0] //大科
		var PersonDep = mui('#'+idStr+'-PersonDep')[0] //所在病房
		var str = ''
		var key = idStr.replace('Per','')
		str = '^'+idStr+'|'+dealUndefined(dom.getAttribute('data-id'))+
			'^'+key+'No|'+dealUndefined(hisNo.innerText)+
			'^'+key+'Lv|'+dealUndefined(PerLeve.getAttribute('data-id'))+
			'^'+key+'Post|'+dealUndefined(Post.getAttribute('data-id'))+
			'^'+key+'Hire|'+dealUndefined(PerDuty.getAttribute('data-id'))+
			'^'+key+'Big|'+dealUndefined(MajorDep.getAttribute('data-id'))+
			'^'+key+'Loc|'+dealUndefined(PersonDep.getAttribute('data-id'))
		return str
	}
	function updatePersonUI(dict,perId,name,idStr){
		if(!dict){
			mui.toast('管理员无法上报！')
			return
		}
		if (perId != undefined) {
			var pagePopo = document.getElementById('pagePopo')
			idStr = pagePopo.getAttribute('data-id');
		}
		var personDom = document.getElementById(idStr);
		var hisNoDom = document.getElementById(idStr + '-hisNo')
		var postDom = document.getElementById(idStr + '-Post')
		var titleDom = document.getElementById(idStr + '-PerDuty')
		var levelDom = document.getElementById(idStr + '-PerLeve')
		var wardDom = document.getElementById(idStr + '-PersonDep')
		var bigLocDom = document.getElementById(idStr + '-MajorDep')
		if (perId == undefined) {
			perId = dict[idStr]
			var key = idStr.replace('Per','')
			personDom.setAttribute('data-id',perId)
			personDom.innerHTML = dict[idStr+'Desc'];
			hisNoDom.innerHTML = dict[key+'No']||'';
			hisNoDom.setAttribute('data-id',dealUndefined(dict[key+'No']));
			postDom.innerText = dict[key+'PostDesc'];
			postDom.setAttribute('data-id',dealUndefined(dict[key+'Post']));
			titleDom.innerText = dict[key+'HireDesc']||'';
			titleDom.setAttribute('data-id',dealUndefined(dict[key+'Hire']));
			levelDom.innerText = dict[key+'LvDesc']||'';
			levelDom.setAttribute('data-id',dealUndefined(dict[key+'Lv']));
			wardDom.innerText = dict[key+'LocDesc']||'';
			wardDom.setAttribute('data-id',dealUndefined(dict[key+'Loc']));
			bigLocDom.innerText = dict[key+'BigDesc']||'';
			bigLocDom.setAttribute('data-id',dealUndefined(dict[key+'Big']));
		}else{
			personDom.setAttribute('data-id', perId);
			personDom.innerHTML = name;
			hisNoDom.innerText = dict['PerID'];
			hisNoDom.setAttribute('data-id',dict['PerID']);
			postDom.innerText = dict['PerPostDutyDesc'];
			postDom.setAttribute('data-id',dict['PerPostDuty'])
			titleDom.innerText = dict['PerHireDutyDesc'];
			titleDom.setAttribute('data-id',dict['PerHireDuty'])
			levelDom.innerText = dict['PerNurseLevelDesc'];
			levelDom.setAttribute('data-id',dict['PerNurseLevel'])
			wardDom.innerText = dict['PerDepDRDesc'];
			wardDom.setAttribute('data-id',dict['PerDepDR'])
			bigLocDom.innerText = dict['PerWardAreaDesc'];
			bigLocDom.setAttribute('data-id',dict['PerWardAreaDR'])
			if (idStr == 'FirstPer' && pageData == undefined) {
				wardDom.innerText = perInfo['loginWardDesc']; //loginWardId
				wardDom.setAttribute('data-id',perInfo['loginWardId'])
				bigLocDom.innerText = perInfo['WardAreaDesc']; //WardAreaDR
				bigLocDom.setAttribute('data-id',perInfo['WardAreaDR'])
			}
		}
		
	}

	function setupIconDownTapped(btn) {
		allInputBlur();
		if(btn.classList.contains('dhc-active')) {
			var popover = document.getElementById('normalPopo');
			popover.classList.remove('mui-active');
			var oldActive = document.querySelector('.dhc-active');
			if(oldActive) {
				oldActive.classList.remove('dhc-active');
			}
			return;
		}else {
			var popover = document.getElementById('normalPopo');
			popover.classList.remove('mui-active');
			var oldActive = document.querySelector('.dhc-active');
			if(oldActive) {
				oldActive.classList.remove('dhc-active');
			}
		}
		btn.classList.add('dhc-active');
		if ('FirstPer,SecPer,ThirdPer'.indexOf(btn.id) != -1) {
			var pagePopo = document.getElementById('pagePopo');
			pagePopo.setAttribute('data-id', btn.id);
			if (popoDict['person']) {
				mui('#pagePopo').popover('show');
			}else{
				getPersonPopoData(true)
			}
		}else {
			var leftTop = getElementAbsPosition(btn);
			var popover = document.getElementById('normalPopo');
			popover.style.left = leftTop['left'] + 'px';
			popover.style.width = (btn.clientWidth + 2) + 'px';
			var top = leftTop['top'] + btn.clientHeight + 1
			var scrollWrapper = document.getElementById('scrollWrapper');
			var maxScroll = scrollWrapper.clientHeight - scrollWrapper.querySelector('.mui-scroll').clientHeight;
			if(maxScroll < 0) {
				var scrollY = mui('#scrollWrapper').scroll().y;
				top = leftTop['top'] + btn.clientHeight + 1 + scrollY
			}
			if(screen.height < top + 172) {
				top = leftTop['top'] - 171
				popover.style.borderTop="solid 1px #24AF96";
				popover.style.borderBottom="0px";
			}else{
				popover.style.borderTop="0px";
				popover.style.borderBottom="solid 1px #24AF96";
			}
			popover.style.top = top + 'px';
			popover.setAttribute('data-id', btn.id);
			var type = btn.getAttribute('data-type')
			if(popoDict[type]) {
				updateNormalPopoverUI(popoDict[type]);
			} else {
				getPopoverData(type, true)
			}
		}
	}

	function pickArticalDate(btn) {
		allInputBlur();
		var popover = document.getElementById('normalPopo');
		popover.classList.remove('mui-active');
		var oldActive = document.querySelector('.dhc-active');
		if(oldActive) {
			oldActive.classList.remove('dhc-active');
		}
		
		var _self = btn;
		if(_self.picker) {
			_self.picker.show(function(rs) {
				_self.innerText = rs.text;
				_self.picker.dispose();
				_self.picker = null;
			});
		} else {
			var optionsJson = '{"type":"date"}';
			var options = JSON.parse(optionsJson);
			_self.picker = new mui.DtPicker(options);
			_self.picker.show(function(rs) {
				_self.innerText = rs.text;
				_self.picker.dispose();
				_self.picker = null;
			});
		}
	}
	function iOSPickArticalDate(btn) {
		allInputBlur();
		var popover = document.getElementById('normalPopo');
		popover.classList.remove('mui-active');
		var oldActive = document.querySelector('.dhc-active');
		if(oldActive) {
			oldActive.classList.remove('dhc-active');
		}
		plus.nativeUI.pickDate(function(e) {
			var d = e.date;
			var dateStr = d.getFullYear()+'-'
			if (d.getMonth() < 9) {
				dateStr += '0'
			}
			dateStr += (d.getMonth() + 1)+'-'
			if (d.getDate() < 10) {
				dateStr += '0'
			}
			dateStr += d.getDate()
			btn.innerText = dateStr
		}, function(e) {}, {});
	}

	function allInputBlur() {
		var inputs = document.querySelectorAll('input');
		for(var i = 0; i < inputs.length; i++) {
			inputs[i].blur();
			inputs[i].classList.remove('dhc-active')
		}
	}

})(mui);
